from django.db import models
from User.models import User
from utils.dateFun import getNowTimeStamp


# Create your models here.


class Note(models.Model):
    """
    Note表
    """
    id = models.CharField(verbose_name='Note id', max_length=255, null=False, primary_key=True)
    content = models.TextField(verbose_name='Note内容 ', null=False)
    timeStamp = models.CharField(verbose_name='编辑时间', max_length=255, null=False)
    creatTimeStamp = models.CharField(verbose_name='创建时间', max_length=255, null=True, default=getNowTimeStamp())
    user = models.ForeignKey(verbose_name="用户ID", to=User, to_field='uid', on_delete=models.CASCADE, null=False)

    class Meta:
        db_table = 'Note'
        verbose_name = 'Note表'
